package com.fable.web.controller.tools;

import com.fable.common.config.RequireLogin;
import com.fable.dal.mapper.ext.CountryExtMapper;
import com.fable.dal.model.CountryDO;
import com.fable.dal.model.CountryQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created by weishuai on 18/7/21.
 */
@Controller
@RequireLogin
@RequestMapping("/tools")
public class ToolsController {

    @Autowired
    CountryExtMapper countryExtMapper;


    @RequestMapping("/countryList.htm")
    public String list(ModelMap model) {
        CountryQuery query = new CountryQuery();
        query.setOrderByClause("id");
        List<CountryDO> list = countryExtMapper.selectByQuery(query);
        model.put("list", list);
        return "tools/countryList";
    }


}
